package com.efuture.mutlithread;

/**
 * @ClassNAME GetThreadName
 * @Description 获取线程的名字
 * @Author zhaoshanshan
 * @Date 2021/9/9 11:31 下午
 * @Version 1.0
 */
public class GetThreadName {

    public static void main(String[] args) {

        GetThreadNameThread t = new GetThreadNameThread();
        System.out.println("子线程名字为:"+t.getName());
        //修改线程名字
        t.setName("test");
        System.out.println("子线程名字为:"+t.getName());

    }
}
class GetThreadNameThread extends Thread{
    @Override
    public void run() {
        System.out.println("我是子线程");
    }
}
